<!-- wireless-table -->
<!-- 车号、车次、故障类型、降级或超时、故障发生时间、故障恢复时间、
故障原因、故障发生公里标、故障所在小区、故障所在RBC区、线路、ATP归属段、定责站段 -->
<!--
alarmreason: "TA值异常，导致连续切换失败，车地交互异常"
alarmtime: 1628575992000
alarmtype: "超时"
atpdept: null
belongdept: null
bureauname: null
cellid: "LDN-SYB12"
cellname: "娄底南-邵阳北12"
dutydept: null
faultcode: null
faulttype: null
guid: null
id: "11737"
jch: null
line: "长昆客专"
mileage: "K1248+909"
msisdn: null
rbcnum: null
recoverykilo: null
recoverytime: null
trainid: "29101"
trainnum: "G1539"
 -->
<template>
    <div class="wireless-table">
        <el-table
        v-loading="loading"
        element-loading-text="拼命加载中"
        element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(0, 0, 0, 0.6)"
        :data="listData"
        border
        height="100%"
        style="width: 100%;">
            <el-table-column
            prop="trainid"
            label="车号">
            </el-table-column>

            <el-table-column
            prop="trainnum"
            label="车次">
            </el-table-column>

            <el-table-column
            prop="faulttype"
            label="故障类型">
            </el-table-column>

            <el-table-column
            prop="alarmtype"
            label="降级或超时">
            </el-table-column>

            <el-table-column
            prop="alarmtime"
            label="故障发生时间">
                <template slot-scope="scope">
                    {{ showTime(scope.row.alarmtime) }}
                </template>
            </el-table-column>

            <el-table-column
            prop="recoverytime"
            label="故障恢复时间">
                <template slot-scope="scope">
                    {{ showTime(scope.row.recoverytime) }}
                </template>
            </el-table-column>

            <el-table-column
            prop="alarmreason"
            label="故障原因">
            </el-table-column>

            <el-table-column
            prop="mileage"
            label="故障发生公里标">
            </el-table-column>

            <el-table-column
            prop="cellname"
            label="故障所在小区">
            </el-table-column>

            <el-table-column
            prop="rbcnum"
            label="故障所在RBC区">
            </el-table-column>

            <el-table-column
            prop="line"
            label="线路">
            </el-table-column>

            <el-table-column
            prop="bureauname"
            label="归属局">
            </el-table-column>

            <el-table-column
            prop="atpdept"
            label="ATP归属段">
            </el-table-column>

            <el-table-column
            prop="dutydept"
            label="定责站段">
            </el-table-column>

            <!-- <el-table-column
            prop="MSISDN"
            label="故障恢复公里标">
            </el-table-column> -->

        </el-table>
    </div>
</template>

<script>
export default {
    name: 'wireless-table',
    props: {
        listData: {
            type: Array,
            default() {
                return [];
            },
        },
        loading: {
            type: Boolean,
            default: false,
        },
    },
    methods: {
        // 显示 yyyy-mm-dd hh:mm:ss
        showTime(time) {
            return time ? (this.$dayjs(time).format('YYYY-MM-DD hh:mm:ss')) : '--';
        },
    },
};
</script>
<style lang="scss">
.wireless-table {
    width: 100%;
    height: 100%;
}
</style>
